import Vue from 'vue'
import App from './App.vue'
import i18n from '@/lang'
import uView from 'uview-ui'
Vue.use(uView)
// import './mock'
// import '@/utils/v-console'

import { router, RouterMount } from '@/router'
import plugins from '@/plugins'

import routerLink from 'uni-simple-router/dist/link.vue'
Vue.component('RouterLink', routerLink)

import store from '@/store'
//#ifdef H5
import '@/utils/touch-emulator'
import settings from '@/settings'
if (process.env.NODE_ENV === 'production') {
  window['settings'] = settings
}
//#endif

Vue.use(plugins)
Vue.use(router)

Vue.config.productionTip = false
;(App as any).mpType = 'app'

//若是开发环境则 是调用拦截，否则，将原来fetch原封不动，给到Vue.prototype.$fetch .
// if (process.env && process.env.NODE_ENV === 'development') {
//   // 这里调用拦截之前封装的fetch请求 fetch.before。
//   require('./mock')
// } else {
// }

const app = new App({
  store,
  i18n,
})

// #ifdef H5
RouterMount(app, router, '#app')
// #endif

// #ifndef H5
app.$mount() //为了兼容小程序及app端必须这样写才有效果
// #endif
